package easy;

import util.PrintUtils;

public class Solution_942 {

    public int[] diStringMatch(String s) {
        char[] chars = s.toCharArray();
        int[] res = new int[chars.length + 1];
        int max = s.length(), min = 1;
        int count_i = 0, count_d = 0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'I') {
                res[i+1] = max--;
            } else {
                res[i+1] = min++;
            }
        }
        return res;
    }

    public static void main(String[] args) {
        Solution_942 model = new Solution_942();
        PrintUtils.arrayInt(model.diStringMatch("IDID"));
        PrintUtils.arrayInt(model.diStringMatch("III"));
    }
}
